<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <title>积分换购</title>
	<%@ include file="../common/common.jsp"%>
	<link rel="stylesheet" type="text/css" href="${ctx}/page/lib/other/css/main.css" />
</head>
<body>
	<div class="bg-silver padding"> 
		<c:forEach items="${categoryKaMiPairs}" var="categoryKaMiPair">
			<div class="margin-top border-left-big border-sub padding-small bg-white">${categoryKaMiPair.kaMiCategory.name}</div>
			<c:forEach items="${categoryKaMiPair.products}" var="product">
				<div class="line margin-top border radius bg-white">
					<div class="padding height ">
						<span class="text-big">${product.name}</span>
					 	<div class="padding-top text-red">
							<c:if test="${vipLevel eq 0}"><fmt:formatNumber type="number" value="${product.exchangePoint}" pattern="0.00" maxFractionDigits="2"/> 积分</c:if>
							 <c:if test="${vipLevel eq 1}"><fmt:formatNumber type="number" value="${product.exchangePoint}" pattern="0.00" maxFractionDigits="2"/> 积分</c:if>
							 <c:if test="${vipLevel eq 2}"><fmt:formatNumber type="number" value="${product.exchangePoint}" pattern="0.00" maxFractionDigits="2"/> 积分</c:if>
							 <c:if test="${vipLevel eq 3}"><fmt:formatNumber type="number" value="${product.exchangePoint}" pattern="0.00" maxFractionDigits="2"/> 积分</c:if>
						 	<span class="text-red">
						 		+

						  	<c:if test="${vipLevel eq 0}"><fmt:formatNumber type="number" value="${product.fansPrice}" pattern="0.00" maxFractionDigits="2"/> 元</c:if>
					 		<c:if test="${vipLevel eq 1}"><fmt:formatNumber type="number" value="${product.baseVipPrice}" pattern="0.00" maxFractionDigits="2"/> 元</c:if>
					 		<c:if test="${vipLevel eq 2}"><fmt:formatNumber type="number" value="${product.highVipPrice}" pattern="0.00" maxFractionDigits="2"/> 元</c:if>
					 		<c:if test="${vipLevel eq 3}"><fmt:formatNumber type="number" value="${product.highVipPrice}" pattern="0.00" maxFractionDigits="2"/> 元</c:if>
						  		<span class="float-right">
						  			<button class="button button-small bg-red radius-rounded" onclick="buyNow(${product.id})" >立即换购</button>
						 	 	</span>
						  	</span>
					 	 </div>
					  </div>
				</div>
			</c:forEach>
		</c:forEach>
	</div>
	<script type="text/javascript">
		function buyNow(kaMiProductId){
			window.location.href=mServerUrl+"/page/confirmKmOrderPage.htm?kaMiProductId="+kaMiProductId+"&time="+((new Date()).getTime());
		}
	</script>
</body>
</html>